<template>
  <back-dialog-base
    :title="title"
    :visible="visibleDialog"
    :hasFooter="false"
    width="15rem"
  >
    <template #content>
      <div class="content-warp">
        <div class="left-box">
          <div class="pic-box">
            <div class="pic"></div>
          </div>
          <div class="info-box">
            <p>发布屏编号: {{ rowData.screenCode }}</p>
            <p>位置信息: {{ rowData.locationInfo }}</p>
          </div>
        </div>
        <div class="right-box">
          <div class="img-box">
            <img class="img" :src="imgUrl" alt="" />
            <div class="title">{{ rowData.mediaName }}</div>
          </div>
          <div class="set-btn" @click="handlePublish">设置</div>
        </div>
      </div>
    </template>
  </back-dialog-base>
</template>

<script setup>
import { defineProps, ref, watch, defineEmits } from 'vue'
import BackDialogBase from '@/components/BackDialogBase'
const props = defineProps({
  title: {
    type: String,
    default: ''
  },
  visibleDialog: {
    type: Boolean,
    default: false
  },
  rowData: {
    type: Object,
    default: () => {}
  }
})
const emits = defineEmits(['handlePub'])
const imgUrl = ref('')
const handlePublish = () => {
  emits('handlePub')
}
watch(
  () => props.rowData,
  () => {
    if (props.rowData.mediaName) {
      imgUrl.value = require('@@/images/back/' + props.rowData.mediaName)
    }
  }
)
</script>

<style lang="scss" scoped>
.content-warp {
  width: 100%;
  height: 100%;
  display: flex;
  .left-box {
    display: flex;
    flex-direction: column;
    margin-right: 50px;
    margin-left: 20px;
    background: v-bind(color);
    .pic-box {
      width: 134px;
      height: 304px;
      padding: 10px 27px 8px 37px;
      background: rgba(255, 255, 255, 0.39);
      box-shadow: 0px 0px 10px rgba(153, 153, 153, 0.2);
      opacity: 1;
      border-radius: 5px;
      .pic {
        width: 100%;
        height: 100%;
        background: url(~@@/images/back/light.png) no-repeat;
        background-size: contain;
      }
    }
    .info-box {
      width: 165px;
      margin-top: 12px;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      line-height: 19px;
      color: #5d6c8e;
      > p {
        width: 162px;
        margin-bottom: 10px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }
    }
  }
  .right-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    align-items: center;
    .img-box {
      width: 193px;
      height: 340px;
      background: rgba(255, 255, 255, 0.39);
      box-shadow: 0px 0px 10px rgba(153, 153, 153, 0.2);
      border-radius: 5px;
      .img {
        width: 193px;
        height: 304px;
      }
      .title {
        width: 100%;
        height: 36px;
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        line-height: 36px;
        text-align: center;
        color: #5d6c8e;
      }
    }
    .set-btn {
      width: 44px;
      height: 32px;
      background: rgba(255, 255, 255, 0.39);
      border: 1px solid #ff9502;
      box-shadow: 0px 0px 4px rgba(206, 206, 206, 0.8);
      border-radius: 5px;
      line-height: 32px;
      text-align: center;
      font-size: 12px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #ff9502;
      cursor: pointer;
      &:hover,
      &:active {
        background: #ff950251;
      }
    }
  }
}
</style>
